package com.kepennar.application.domain;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the events database table.
 * 
 */
@Entity
@Table(name="events")
public class Event implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idEvents;
	private Date dateDebut;
	private Date dateFin;
	private String description;
	private String title;
	private Set<Comment> comments;
	private Account account;
	private Set<Invitation> invitations;

    public Event() {
    }


	@Id
	@Column(name="id_events", unique=true, nullable=false)
	public int getIdEvents() {
		return this.idEvents;
	}

	public void setIdEvents(int idEvents) {
		this.idEvents = idEvents;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="date_debut", nullable=false)
	public Date getDateDebut() {
		return this.dateDebut;
	}

	public void setDateDebut(Date dateDebut) {
		this.dateDebut = dateDebut;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="date_fin")
	public Date getDateFin() {
		return this.dateFin;
	}

	public void setDateFin(Date dateFin) {
		this.dateFin = dateFin;
	}


	@Column(length=400)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}


	@Column(nullable=false, length=255)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}


	//bi-directional many-to-one association to Comment
	@OneToMany(mappedBy="event")
	public Set<Comment> getComments() {
		return this.comments;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}
	

	//bi-directional many-to-one association to Account
    @ManyToOne
	@JoinColumn(name="id_account", nullable=false)
	public Account getAccount() {
		return this.account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
	

	//bi-directional many-to-one association to Invitation
	@OneToMany(mappedBy="event")
	public Set<Invitation> getInvitations() {
		return this.invitations;
	}

	public void setInvitations(Set<Invitation> invitations) {
		this.invitations = invitations;
	}
	
}